package com.example.love_margin.Controller;


import com.example.love_margin.Entity.User;
import com.example.love_margin.Service.MyService;
import com.example.love_margin.Service.SponsorshipService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Api(value = "我的",tags = "登录/注册")
@RestController
@RequestMapping(value = "/login",name = "我的")
@CrossOrigin
public class MyLoginController {

    @Autowired
    MyService myService;

    @Autowired
    SponsorshipService sponsorshipService;

    //登录,如果没有就直接创建新用户，并返回信息
    @ApiOperation(value = "登录",notes = "登录,如果没有就直接创建新用户，并返回信息")
    @PostMapping(value = "/myLogin")
    public Object myLogin(@RequestBody User user){
        return myService.addUser(user);
    }

//    //申请助养宠物
//    @ApiOperation(value = "申请助养宠物",notes = "申请助养宠物")
//    @PostMapping(value = "/mySponsorshipPets")
//    public Object mySponsorshipPets(@RequestBody Sponsorship sponsorship){
//        return sponsorshipService.addSponsorship(sponsorship);
//    }
//
//
//
//
//
//    //我的领养
//    public Object myAdoptPets(){
//        return "";
//    }



}
